package com.sky.controller.user;

import com.sky.entity.Category;
import com.sky.result.Result;
import com.sky.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping( "/user/category")
@RestController
public class CategoryController {

    @Autowired
     private CategoryService categoryService;

    @GetMapping ("/list")
    public Result<List<Category>> selectByType(Integer type) {
        List<Category> list = categoryService.selectByType(type);
        return Result.success(list);
    }
}
